package com.example.firstobject

import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.example.firstobject.view.VerificationCodeView

class MainActivity : AppCompatActivity() {

    private lateinit var viewVerification: VerificationCodeView
    private lateinit var btnModuleSubmit : Button

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        viewVerification = findViewById(R.id.view_verification)
        btnModuleSubmit = findViewById(R.id.btnModuleSubmit)
        btnModuleSubmit.setOnClickListener(View.OnClickListener {
            if (viewVerification.isFinish) {
                Toast.makeText(this,"提交验证码 ${viewVerification.content}",Toast.LENGTH_SHORT).show()
            }else{
                Toast.makeText(this,"情输入完整验证码",Toast.LENGTH_LONG).show()
            }
        })
    }
}